***********************************************************************************************
**************************CLOSING THE GENDER GAP IN SALARY INCREASES:**************************
*******************EVIDENCE FROM A FIELD EXPERIMENT ON PROMOTING PAY EQUITY********************
***********************************************************************************************
*****THIS SCRIPT REPLICATES ALL TABLES AND FIGURES IN THE ORDER OF APPEARANCE IN THE PAPER*****
***********************************************************************************************

clear all
set more off

**# PRELIMINARIES

**## Install commands

*Install user-written packages required for execution:
local cmds estout reghdfe ftools addplot
foreach cmd of local cmds {
	qui capture ssc install `cmd'
}

**## Load data
use payequity, clear

**# RESULTS

**## Paper

**### Table 2: Summary of employee and middle manager characteristics

**#### Panel A: Employee characteristics
tabstat ttc_prior_fte_std posrange female tenure age_cont fte, ///
by(treatment) statistics(mean sd n) columns(statistics) format(%3.2f) labelwidth(18) varwidth(18) longstub

**#### Panel B: Middle manager characteristics
tabstat soc man_female man_tenure man_age_cont man_fte if team_unique==1, ///
by(treatment) statistics(mean sd n) columns(statistics) format(%3.2f) labelwidth(18) varwidth(18) longstub

**### Table 3: Gender gap in prior salaries
eststo: qui reg ln_ttc_prior_fte i.female i.countryXunit, vce(cluster man_id)
eststo: qui reg ln_ttc_prior_fte i.female i.countryXunitXjob, vce(cluster man_id)
eststo: qui reg ln_ttc_prior_fte i.female i.countryXunitXjobXlevel, vce(cluster man_id)
eststo: qui reg ln_ttc_prior_fte i.female i.countryXunitXjobXlevel c.tenure i.age c.fte, vce(cluster man_id)
esttab, noomitted nobaselevels drop(*.countryXunit* tenure *.age fte _cons) b(%6.5f) se(%6.5f) ar2(%3.2f) star(* 0.1 ** 0.05 *** 0.01) ///
stats(N_clust N r2_a, fmt(%3.0f %4.0f %3.2f) labels("Teams" "Observations" "R2 (adj.)")) nomtitles coeflabels(1.female "Female")
eststo clear

**### Table 4: Treatment effects on the gender gap in salary increases
eststo: qui reg merit_rate_norm i.female##i.treatment c.posrange i.countryXunitXjobXlevel c.tenure i.age c.fte, vce(cluster man_id)
eststo: qui reg ln_ttc_post_fte i.female##i.treatment c.ln_ttc_prior_fte i.countryXunitXjobXlevel c.tenure i.age c.fte, vce(cluster man_id)
esttab, noomitted nobaselevels drop(*.countryXunitXjobXlevel tenure *.age fte _cons) b(%6.5f) se(%6.5f) star(* 0.1 ** 0.05 *** 0.01) varwidth(24) ///
stats(N_clust N, fmt(%3.0f %4.0f) labels("Teams" "Observations")) nomtitles ///
order(1.female 1.treatment 1.female#1.treatment 2.treatment 1.female#2.treatment 3.treatment 1.female#3.treatment posrange ln_ttc_prior_fte) ///
coeflabel(1.female "Female" 1.treatment "Budget" 1.female#1.treatment "Female X Budget" 2.treatment "Guidance Range" 1.female#2.treatment "Female X Guidance Range" 3.treatment "Guidance Value" 1.female#3.treatment "Female X Guidance Value" posrange "Position in salary band" ln_ttc_prior_fte "ln(Prior salary)")
eststo clear

**### Table 5: Treatment effects on the within-team gender gap in salary increases

*Define within-team gender gaps:
preserve

*Summarize by team and gender:
collapse (mean) ttc_*_fte merit_rate_norm posrange treatment band_mode_team age_mean_team tenure_mean_team fte_mean_team female_mean_team posrange_mean_team, by(man_id female)
qui reshape wide ttc_*_fte merit_rate_norm posrange, i(man_id) j(female)
*Within-team gender gap in (prior/posterior) saleries:
qui gen gg_within_ttc_post = (1-ttc_post_fte1/ttc_post_fte0)
qui gen gg_within_ttc_prior = (1-ttc_prior_fte1/ttc_prior_fte0)
*Within-team gender gap in salary increases (normalized):
qui gen gg_within_rate_norm = (1-merit_rate_norm1/merit_rate_norm0)
*Within-team gender gap in position in salary band:
qui gen gg_within_posrange = (1-posrange1/posrange0)

eststo: qui reg gg_within_rate_norm i.treatment c.gg_within_posrange i.band_mode_team c.age_mean_team c.tenure_mean_team c.fte_mean_team c.female_mean_team, vce(cluster man_id)
eststo: qui reg gg_within_ttc_post i.treatment c.gg_within_ttc_prior i.band_mode_team c.age_mean_team c.tenure_mean_team c.fte_mean_team c.female_mean_team, vce(cluster man_id)
esttab, noomitted nobaselevels drop(*.band_mode_team tenure_mean_team age_mean_team fte_mean_team female_mean_team _cons) b(%6.5f) se(%6.5f) star(* 0.1 ** 0.05 *** 0.01) varwidth(49) ///
stats(N_clust N, fmt(%3.0f %3.0f) labels("Teams" "Observations")) nomtitles ///
coeflabel(1.treatment "Budget" 2.treatment "Guidance Range" 3.treatment "Guidance Value" gg_within_posrange "Within-team gender gap in position in salary band" gg_within_ttc_prior "Within-team gender gap in prior salaries")
eststo clear

restore

**### Figure 4: Magnitude of relative treatment effects vis-à-vis benchmark scenarios

frame copy default benchmark
frame benchmark {

	qui expand 3 if treatment==0, gen(copy)
	qui bys man_id emp_id copy: gen bench = _n if copy==1
	drop copy

	*Benchmark 1:
	qui replace merit_rate_norm = merit_rate_norm * (1+budget_delta_team_rel/100) if bench==1
	*Benchmark 2:
	qui replace merit_rate_norm = guidance_value/merit_budget_country if bench==2

	qui replace treatment=4 if bench==1
	qui replace treatment=5 if bench==2
	drop bench

	*Original model:
	qui reg merit_rate_norm i.treatment##i.female c.posrange i.countryXunitXjobXlevel c.tenure i.age c.fte if !inlist(treatment,4,5), vce(cluster man_id)
	mat A = r(table)
	scalar a = abs(A["b","1.female"])
	*Benchmarks:
	qui reghdfe merit_rate_norm i.treatment##i.female if inlist(treatment,0,4,5), vce(cluster man_id) absorb(emp_id)
	mat B = r(table)

	*Combine, extract, and transform coefficients:
	mat C = A,B
	mat D = J(5,2,.)
	forval i=1/5 {
		mat D[`i',1]=C["b","`i'.treatment#1.female"]/scalar(a)*100
		mat D[`i',2]=`i'
	}
	mat colnames D = b treat

	preserve
	
	clear

	qui svmat D, names(col)

	tw bar b treat if inrange(treat,1,3), barw(0.9) fc("214 214 214") lwidth(0.5) lc(black) || ///
		bar b treat if inrange(treat,4,5), barw(0.9) fc("114 114 114") lwidth(0.5) lc(black) ///
		xaxis(1 2) ///
		xtitle("", axis(1)) ///
		xtitle("", axis(2)) ///
		ytitle("Reduction in gender gap in normalized" "salary increases relative to control group (%)", margin(small)) ///
		xlab(1 "Budget" 2 `" "Guidance" "Range" "' 3 `" "Guidance" "Value" "' 4 `" "Budget" "Effect" "' 5 `" "Perfect" "Compliance" "', noticks axis(2)) ///
		xlab(2 "Treatments" 4.5 `" "Benchmark" "Scenarios" "', noticks axis(1)) ///
		ylab(0(25)125) ///
		yline(0(25)75, lp(dot) lc(black)) ///
		yline(125, lp(dot) lc(black)) ///
		yline(100, lp(dash) lc(black)) ///
		legend(off) ///
		scheme(s1mono) ///
		xsize(5) ///
		ysize(4)
		
		restore
}

**### Figure 5: Deviation from budgeted salary increases by treatment, position in salary band, and employee gender

preserve

*Round to one decimal point:
foreach var of varlist merit_rate guidance_value {
	qui gen `var'_rnd=round(`var',0.1)
}
*Relative deviation of (rounded) merit rate from (rounded) guidance, rounded to nearest integer:
qui gen dev=round((merit_rate_rnd-guidance_value_rnd)/guidance_value_rnd*100)

qui keep if posrange<=1

qui sum posrange
local a `r(min)'

*Bin position in range:
egen posrange_cat = cut(posrange), at(`a' 0 0.33 0.67 1.1) icodes label

*Get mininum position in range by treatment to indicate intervals:
forval i=1/3 {
	qui sum posrange if treatment==`i'
	local min_lab_`i' "`: di %3.2fc = `r(min)''"
}

collapse (mean) dev (count) n=dev (sd) sd=dev, by(posrange_cat female treatment)

*Standard errors of the mean:
qui gen lb=dev-sd/sqrt(n)
qui gen ub=dev+sd/sqrt(n)

qui gen x = posrange_cat*2.5
qui replace x = x-0.5 if female==0
qui replace x = x+0.5 if female==1

qui keep if treat!=0

qui gen t=treatment
label define t_label 1 "Budget" 2 "Guidance Range" 3 "Guidance Value"
label values t t_label

tw (bar dev x if female==0, lc(black) fc("114 114 114")) ///
(rcap lb ub x if female==0, lc(black)) ///
(bar dev x if female==1, lc(black) fc("214 214 214")) ///
(rcap lb ub x if female==1, lc(black)), ///
by(t, note("") row(1)) ///
subtitle(,lc(none) fc(none)) ///
xtitle("Position in salary band", margin(small)) ///
ytitle("Deviation of salary increase" "from budgeted salary increase" "(in percent of budgeted salary increase)", margin(small)) ///
xlab(0 "[`min_lab_1',0)" 2.5 "[0,0.33)" 5 "[0.33,0.67)" 7.5 "[0.67,1]", alternate) ///
ylab(-50 "-50" 0 "±0" 50 "+50" 100 "+100" 150 "+150" 200 "+200") ///
yline(-50, lc(black) lp(dot)) ///
yline(0, lc(black) lp(dash)) ///
yline(50(50)200, lc(black) lp(dot)) ///
legend(order (1 3) label(1 "Male") label(3 "Female")) ///
scheme(s1mono) ///
xsize(5) ///
ysize(4) ///
name(g1, replace)

addplot g1 2:, xlab(0 "[`min_lab_2',0)" 2.5 "[0,0.33)" 5 "[0.33,0.67)" 7.5 "[0.67,1]", alternate)
addplot g1 3:, xlab(0 "[`min_lab_3',0)" 2.5 "[0,0.33)" 5 "[0.33,0.67)" 7.5 "[0.67,1]", alternate)

restore

**### Table 6: Treatment effects on the gender gap in salary increases by middle manager gender
eststo: qui reg ln_ttc_post_fte i.female##i.treatment c.ln_ttc_prior_fte i.countryXunitXjobXlevel c.tenure i.age c.fte if man_female==0, vce(cluster man_id)
eststo: qui reg ln_ttc_post_fte i.female##i.treatment c.ln_ttc_prior_fte i.countryXunitXjobXlevel c.tenure i.age c.fte if man_female==1, vce(cluster man_id)
esttab, noomitted nobaselevels drop(*.countryXunitXjobXlevel tenure *.age fte _cons) b(%6.5f) se(%6.5f) star(* 0.1 ** 0.05 *** 0.01) varwidth(24) ///
stats(N_clust N, fmt(%3.0f %4.0f) labels("Teams" "Observations")) nomtitles ///
order(1.female 1.treatment 1.female#1.treatment 2.treatment 1.female#2.treatment 3.treatment 1.female#3.treatment ln_ttc_prior_fte) ///
coeflabel(1.female "Female" 1.treatment "Budget" 1.female#1.treatment "Female X Budget" 2.treatment "Guidance Range" 1.female#2.treatment "Female X Guidance Range" 3.treatment "Guidance Value" 1.female#3.treatment "Female X Guidance Value" ln_ttc_prior_fte "ln(Prior salary)")
eststo clear

**### Table 7: Treatment effects on performance differentiation
foreach var of varlist talent bonus util {
	qui gen perform = `var'
	eststo: qui reg ln_ttc_post_fte c.perform##i.treatment c.ln_ttc_prior_fte i.countryXunitXjobXlevel c.tenure i.age c.fte i.female, vce(cluster man_id)
	drop perform
}
esttab, noomitted nobaselevels drop(*.countryXunitXjobXlevel tenure *.age fte *.female _cons) b(%6.5f) se(%6.5f) star(* 0.1 ** 0.05 *** 0.01) varwidth(36) ///
stats(N_clust N, fmt(%3.0f %4.0f) labels("Teams" "Observations")) nomtitles ///
order(perform 1.treatment 1.treatment#c.perform 2.treatment 2.treatment#c.perform 3.treatment 3.treatment#c.perform ln_ttc_prior_fte) ///
coeflabel(perform "Performance measure" 1.treatment "Budget" 1.treatment#c.perform "Performance measure X Budget" 2.treatment "Guidance Range" 2.treatment#c.perform "Performance measure X Guidance Range" 3.treatment "Guidance Value" 3.treatment#c.perform "Performance measure X Guidance Value" ln_ttc_prior_fte "ln(Prior salary)")
eststo clear

**### Table 8: Treatment effects on employee and middle manager perceptions

*Employees:
frame put emp_id man_id treatment budget_gain countryXunitXjobXlevel age tenure fte female budget_spent_share, into(survey_emp)
frame survey_emp {
	
	qui merge 1:1 emp_id using survey_emp, keep(match master) nogenerate
	
	qui clonevar emp_fair = emp_q11
	qui egen emp_fair_z = std(emp_fair)
}

*Middle managers:
frame put man_id treatment budget_gain_team band_mode age_mean_team tenure_mean_team fte_mean_team female_mean_team budget_spent_team_share if team_unique==1, into(survey_man)
frame survey_man {
	
	qui merge 1:1 man_id using survey_man, keep(match master) nogenerate
	
	qui clonevar man_satis = man_q1
	qui egen man_satis_z = std(man_satis)
	
	*Clone and rename interaction variable to refer to it consistently across middle manager and employee frames:
	qui clonevar budget_gain = budget_gain_team
}

eststo: frame survey_emp: qui reg emp_fair_z i.treatment i.countryXunitXjobXlevel c.tenure i.age c.fte i.female c.budget_spent_share if finished==1, vce(cluster man_id)
eststo: frame survey_emp: qui reg emp_fair_z i.treatment##i.budget_gain i.countryXunitXjobXlevel c.tenure i.age c.fte i.female c.budget_spent_share if finished==1, vce(cluster man_id)
eststo: frame survey_man: qui reg man_satis_z i.treatment i.band_mode_team c.tenure_mean_team c.age_mean_team c.fte_mean_team c.female_mean_team c.budget_spent_team_share if finished==1, vce(cluster man_id)
eststo: frame survey_man: qui reg man_satis_z i.treatment##i.budget_gain i.band_mode_team c.tenure_mean_team c.age_mean_team c.fte_mean_team c.female_mean_team c.budget_spent_team_share if finished==1, vce(cluster man_id)
esttab, noomitted nobaselevels drop(*.countryXunitXjobXlevel *.band_mode_team tenure* *age* fte* *female* budget_spent_*share _cons) ///
b(%6.5f) se(%6.5f) star(* 0.1 ** 0.05 *** 0.01) varwidth(31) ///
stats(N_clust N, fmt(%3.0f %4.0f) labels("Teams" "Observations")) nomtitles ///
order(1.treatment 2.treatment 3.treatment 1.budget_gain 1.treatment#1.budget_gain 2.treatment#1.budget_gain 3.treatment#1.budget_gain) ///
coeflabel(1.treatment "Budget" 2.treatment "Guidance Range" 3.treatment "Guidance Value" 1.budget_gain "Budget gained (hypothetical)" 1.treatment#1.budget_gain "Budget X Budget gained" 2.treatment#1.budget_gain "Guidance Range X Budget gained" 3.treatment#1.budget_gain "Guidance Value X Budget gained")
eststo clear

**### Figure 6: Word clouds of middle manager perception of salary review process by classified sentiment

*See Python script textanalysis.py!

**## Appendix

**### Figure A1: Distribution of deviations from budgeted salary increase by treatment

preserve

*Round to one decimal point:
foreach var of varlist merit_rate guidance_value {
	qui gen `var'_rnd=round(`var',0.1)
}
*Relative deviation of (rounded) salary increase from (rounded) budgeted salary increase, rounded to nearest integer:
qui gen dev=round((merit_rate_rnd-guidance_value_rnd)/guidance_value_rnd*100)

*Frequencies:
qui tab dev treatment, missing matcell(freq) matrow(dev) matcol(treat)
mat A=dev,freq

*Get column names:
local nam ""
forval i = 1/`=colsof(treat)' {
      local nam `nam' freq`=treat[1,`i']'
}
mat colnames A = dev `nam'

*Convert matrix to variables:
clear
qui svmat A, names(col)
*Get total number of observations and relative frequencies by treatment:
forval i =1/`=colsof(treat)' {
	local t `=treat[1,`i']'
	qui egen tot`t' = total(freq`t')
	qui gen relfreq`t' = freq`t'/tot`t'*100
}

keep dev relfreq*
qui reshape long relfreq, i(dev) j(t)

label define t_label 0 "Control" 1 "Budget" 2 "Guidance Range" 3 "Guidance Value"
label values t t_label

tw bar relfreq dev if t!=0 & inrange(dev,-99,99), ///
by(t, note("") row(1)) ///
subtitle(,lc(none) fc(none)) ///
lc(black) fc(black) barw(1) ///
xtitle("Deviation of salary increase from budgeted salary increase" "(in percent of budgeted salary increase)") ///
ytitle(Percentage of employees, margin(small)) ///
ylab(0(2)10) ///
yline(0(2)10, lc(black) lp(dot)) ///
scheme(s1mono) ///
xsize(5) ///
ysize(4)

restore

**### Figure A2: Relative budget adjustment by share of female employees per team

preserve

qui keep if treatment!=0

collapse female budget_delta_team_rel, by(man_id)

*In percent:
qui replace female = female*100
*Get min/max:
qui sum female
local min_lab "`: di %1.0fc = `r(min)''"
local max_lab "`: di %3.0fc = `r(max)''"
*Get terciles:
_pctile female, nq(3)
scalar t2min = `r(r1)'
scalar t2max = `r(r2)'
local t2min_lab "`: di %4.2fc = `r(r1)''"
local t2max_lab "`: di %4.2fc = `r(r2)''"
*Categorize:
qui gen female_cat = 1
qui replace female_cat = 2 if inrange(female,scalar(t2min),scalar(t2max))
qui replace female_cat = 3 if female > scalar(t2max)

collapse (mean) budget_delta_team_rel (count) n = budget_delta_team_rel (sd) sd = budget_delta_team_rel, by(female_cat)

*Standard errors of the mean:
qui gen lb=budget_delta_team_rel-sd/sqrt(n)
qui gen ub=budget_delta_team_rel+sd/sqrt(n)

tw bar budget_delta_team_rel female_cat, barw(0.9) fc("214 214 214") lw(0.5) lc(black) || ///
	rcap lb ub female_cat, lc(black) lw(0.5) ///
	xtitle("Share of female employees per team (%)", margin(small)) ///
	ytitle("Relative budget adjustment (%)", margin(small)) ///
	xlab(1 `" "1st tercile" "[`min_lab', `t2min_lab')" "' 2 `" "2nd tercile" "[`t2min_lab', `t2max_lab']" "' 3 `" "3rd tercile" "(`t2max_lab', `max_lab']" "') ///
	ylab(-1.5(0.5)3) ///
	ylab(-0.5 "-0.5" 0 "±0" 0.5 "+0.5" 1 "+1" 1.5 "+1.5" 2 "+2" 2.5 "+2.5" 3 "+3", add) ///
	yline(-1.5(0.5)-0.5, lp(dot) lc(black)) ///
	yline(0.5(0.5)3, lp(dot) lc(black)) ///
	yline(0, lp(dash) lc(black)) ///
	legend(off) ///
	scheme(s1mono) ///
	xsize(5) ///
	ysize(4)

restore

**### Table A1: Treatment effects on the gender gap in salary increases by relative budget adjustment

*Get min, max, and terciles of relative budget adjustment:
qui sum budget_delta_team_rel if team_unique==1
local min_lab "`: di %5.2fc = `r(min)''"
local max_lab "`: di %5.2fc = `r(max)''"
qui _pctile budget_delta_team_rel if team_unique==1, nquantiles(3)
scalar t2min = `r(r1)'
scalar t2max = `r(r2)'
local t2min_lab "`: di %5.2fc = `r(r1)''"
local t2max_lab "`: di %3.2fc = `r(r2)''"

eststo: qui reg ln_ttc_post_fte i.female##i.treatment c.ln_ttc_prior_fte i.countryXunitXjobXlevel c.tenure i.age c.fte if budget_delta_team_rel<scalar(t2min), vce(cluster man_id)
eststo: qui reg ln_ttc_post_fte i.female##i.treatment c.ln_ttc_prior_fte i.countryXunitXjobXlevel c.tenure i.age c.fte if inrange(budget_delta_team_rel,scalar(t2min),scalar(t2max)), vce(cluster man_id)
eststo: qui reg ln_ttc_post_fte i.female##i.treatment c.ln_ttc_prior_fte i.countryXunitXjobXlevel c.tenure i.age c.fte if budget_delta_team_rel>scalar(t2max), vce(cluster man_id)
esttab, noomitted nobaselevels drop(*.countryXunitXjobXlevel tenure *.age fte _cons) b(%6.5f) se(%6.5f) star(* 0.1 ** 0.05 *** 0.01) varwidth(24) ///
stats(N_clust N, fmt(%3.0f %4.0f) labels("Teams" "Observations")) nomtitles ///
order(1.female 1.treatment 1.female#1.treatment 2.treatment 1.female#2.treatment 3.treatment 1.female#3.treatment ln_ttc_prior_fte) ///
coeflabel(1.female "Female" 1.treatment "Budget" 1.female#1.treatment "Female X Budget" 2.treatment "Guidance Range" 1.female#2.treatment "Female X Guidance Range" 3.treatment "Guidance Value" 1.female#3.treatment "Female X Guidance Value" ln_ttc_prior_fte "ln(Prior salary)")
eststo clear

**### Table A2: Treatment effects on the gender gap in salary increases relative to benchmark scenarios
eststo: frame benchmark: qui reg merit_rate_norm i.female##ib4.treatment c.posrange i.countryXunitXjobXlevel c.tenure i.age c.fte if !inlist(treatment,0,5), vce(cluster man_id)
eststo: frame benchmark: qui reg merit_rate_norm i.female##ib5.treatment c.posrange i.countryXunitXjobXlevel c.tenure i.age c.fte if !inlist(treatment,0,4), vce(cluster man_id)
esttab, noomitted nobaselevels drop(*.countryXunitXjobXlevel tenure *.age fte _cons) b(%6.5f) se(%6.5f) star(* 0.1 ** 0.05 *** 0.01) varwidth(23) ///
stats(N_clust N, fmt(%3.0f %4.0f) labels("Teams" "Observations")) nomtitles ///
order(1.female 1.treatment 1.female#1.treatment 2.treatment 1.female#2.treatment 3.treatment 1.female#3.treatment posrange) ///
coeflabel(1.female "Female" 1.treatment "Budget" 1.female#1.treatment "Female X Budget" 2.treatment "Guidance Range" 1.female#2.treatment "Female X Guidance Range" 3.treatment "Guidance Value" 1.female#3.treatment "Female X Guidance Value" posrange "Position in salary band")
eststo clear

**### Table A3: Treatment effects on pay accountability

frame survey_emp {
	qui clonevar emp_just = emp_q5
	*Reverse code extent to which middle manager referred to external circumstances beyond their control to justify salary increase decision to obtain perceived accountability:
	qui clonevar emp_acc = emp_just
	qui replace emp_acc = abs(emp_just-6)
	qui egen emp_acc_z = std(emp_acc)
}

frame survey_man {
	qui clonevar man_acc = man_q2
	qui egen man_acc_z = std(man_acc)
}

eststo: frame survey_emp: qui reg emp_acc_z i.treatment i.countryXunitXjobXlevel c.tenure i.age c.fte i.female c.budget_spent_share if finished==1, vce(cluster man_id)
eststo: frame survey_emp: qui reg emp_acc_z i.treatment##i.budget_gain i.countryXunitXjobXlevel c.tenure i.age c.fte i.female c.budget_spent_share if finished==1, vce(cluster man_id)
eststo: frame survey_man: qui reg man_acc_z i.treatment i.band_mode_team c.tenure_mean_team c.age_mean_team c.fte_mean_team c.female_mean_team c.budget_spent_team_share if finished==1, vce(cluster man_id)
eststo: frame survey_man: qui reg man_acc_z i.treatment##i.budget_gain i.band_mode_team c.tenure_mean_team c.age_mean_team c.fte_mean_team c.female_mean_team c.budget_spent_team_share if finished==1, vce(cluster man_id)
esttab, noomitted nobaselevels drop(*.countryXunitXjobXlevel *.band_mode_team tenure* *age* fte* *female* budget_spent_*share _cons) ///
b(%6.5f) se(%6.5f) star(* 0.1 ** 0.05 *** 0.01) varwidth(31) ///
stats(N_clust N, fmt(%3.0f %4.0f) labels("Teams" "Observations")) nomtitles ///
order(1.treatment 2.treatment 3.treatment 1.budget_gain 1.treatment#1.budget_gain 2.treatment#1.budget_gain 3.treatment#1.budget_gain) ///
coeflabel(1.treatment "Budget" 2.treatment "Guidance Range" 3.treatment "Guidance Value" 1.budget_gain "Budget gained (hypothetical)" 1.treatment#1.budget_gain "Budget X Budget gained" 2.treatment#1.budget_gain "Guidance Range X Budget gained" 3.treatment#1.budget_gain "Guidance Value X Budget gained")
eststo clear
